<!DOCTYPE html>
<html lang="en">
  <head>
  <meta charset="utf-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <meta name="description" content="Kode is a Premium Bootstrap Admin Template, It's responsive, clean coded and mobile friendly">
  <meta name="keywords" content="bootstrap, admin, dashboard, flat admin template, responsive," />
  <script src="/AD/js/jquery-1.6.2.min.js"></script>
  <title>{{Config::get('app.title')}}</title>

  <!-- ========== Css Files ========== -->
  <link href="/AD/css/root.css" rel="stylesheet">
  <style type="text/css">
    body{background: #F5F5F5;}
  </style>
  </head>
  <body>

    <div class="login-form">
      <form action="{{url('login/loginpro')}}" method="post" onsubmit="return check()">
        <div class="top">
          <img src="/AD/img/kode-icon.png" alt="icon" class="icon">
          <h1>DR</h1>
        </div>
        <input type="hidden" name="_token" value="{{ csrf_token() }}" />
        <div class="form-area">
          <div class="group">
            <input type="text" id="user" class="form-control" name="adminName" value="{{old('adminName')}}" placeholder="用户名">
            <i class="fa fa-user"></i>
          </div>

          <div class="group">
            <input type="password" id="pass" class="form-control" name="password" value="{{old('password')}}" placeholder="密码">
            <i class="fa fa-key"></i>
            @if(Session::has('error'))
            <div id="message" style="width:180px;height:20px;margin-top:10px;color:red;">{{Session::get('error')}}</div>
            @endif
            <div id="error"style="width:180px;height:20px;margin-top:10px;display:none;color:red;"></div>
          </div>
          <div class="checkbox checkbox-primary">
            <input id="checkbox101" type="checkbox" checked>
            <label for="checkbox101">记住我</label>
          </div>
          <button type="submit" class="btn btn-default btn-block">登录</button>
        </div>
      </form>
      <div class="footer-links row">
        <div class="col-xs-6"><!-- <a href="{{url('login/register')}}"><i class="fa fa-external-link"></i>马上注册</a> --></div>
        <div class="col-xs-6 text-right"><a href="#"><i class="fa fa-lock"></i> 忘记密码</a></div>
      </div>
    </div>

    <script>
          function check(){
              var user = $('#user').attr("value");
              var pass = $('#pass').attr("value");
              if(user == '' || pass ==''){
                  $("#message").css('display','none');
                  $("#error").css('display','block');
                  $("#error").html("用户名和密码不能为空");
                  return false;
              }else{
                  return true;
              }
          }   
    </script>
</body>
</html>